package thread.threaddemo;

/**
 * @Author: wenjingyuan
 * @Date: 2022/11/03/16:59
 * @Description:获取线程的优先级
 */
public class ThreadDemoByPriority {
    public static void main(String[] args) throws InterruptedException {
      Thread thread=new Thread(new Runnable() {
          @Override
          public void run() {
              System.out.println("线程的优先级1:"+Thread.currentThread().getPriority());
          }
      });
        System.out.println("线程的优先级2:"+Thread.currentThread().getPriority());
        thread.start();
        System.out.println("线程的优先级3:"+thread.getPriority());
        Thread.sleep(500);
        System.out.println("线程的优先级4:"+thread.getPriority());
    }
}
